package com.itheima.ui;

import java.util.ArrayList;
import java.util.Collection;
import java.util.function.Consumer;

/**
 * @author zhangbaiyan
 * @date 2024-09-08 14:26
 * @description:
 * @version:
 */
public class foreachbianli {
    public static void main(String[] args) {
        Collection coll = new ArrayList();
        coll.add("hello");
        coll.add("world");
        coll.add("java");

//        for (Object o : coll) {
//            System.out.println(o);
//        }
        coll.forEach(new Consumer<String>() {
            @Override
            public void accept(String o) {
                System.out.println(o);
            }
        });
        int i = (int) 9.99;

//        coll.forEach(System.out::println);
    }
}
